﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="DanhSachSanPham.aspx.cs" Inherits="Cart.DanhSachSanPham" %>
<%@ Register Assembly="vdc_AJAXPage" Namespace="VdcInc" TagPrefix="vajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script type="text/javascript" charset="utf-8">
        function fnChangeLoai(ddl) {
            var a = ddl.options[ddl.selectedIndex].value;
            ob_post.AddParam('strLoaiId', a);
            ob_post.post(null, "vThayDoiLoai", ResultThayDoiLoai);
        }
        function ResultThayDoiLoai(result, ex) {
            
        }
        function ShowDialog(url, w, h) {
            var name = "";
            w += 32;
            h += 96;
            wleft = (screen.width - w) / 2;
            wtop = (screen.height - h) / 2;
            if (wleft < 0) {
                w = screen.width;
                wleft = 0;
            }
            if (wtop < 0) {
                h = screen.height;
                wtop = 0;
            }
            var win = window.open(url, name, 'width=' + w + ', height=' + h + ', ' + 'left=' + wleft + ', top=' + wtop + ', ' + 'location=no, menubar=no, ' + 'status=no, toolbar=no, scrollbars=yes, resizable=no');
            win.resizeTo(w, h);
            win.moveTo(wleft, wtop);
            win.focus();
        }


        function XoaSanPham(id) {
            var answer = confirm("Bạn có chắc muốn xóa sản phẩm này ko ?")
            if (answer) {
                ob_post.AddParam('strSanPhamId', id);
                ob_post.post(null, "vXoaSanPham", ResultXoaSanPham);
            }
        }
        function ResultXoaSanPham(result, ex) {
            alert(result);
            window.location = "DanhSachSanPham.aspx";
        }
        </script>
    <div class="content_buy_cart">
        <div class="buy_cart_top">
        </div>

        <div class="buy_cart_content">
            <div class="profile_breadcrumbs">
                <ul>
                    <li>
                        <a class="active" href="DanhSachSanPham.aspx" title="">Sản phẩm
                        </a>
                    </li>

                    <li>|
                    </li>

                    <li>
                        <a class="" href="Ds_LoaiSP.aspx" title="">Loại sản phẩm
                        </a>
                    </li>

                    <li>|
                    </li>

                    <li>
                        <a class="" href="DanhSachNguoiDung.aspx" title="">Người dùng
                        </a>
                    </li>
                    <li>|
                    </li>
                    <li>
                        <a class="" href="ThongKeHoaDon.aspx" title="">Hóa đơn bán hàng
                        </a>
                    </li>
                </ul>

            </div>

            <!-- cart-detail-begin -->
            <p class="buy_cart_title">
                Loại sản phẩm : <asp:DropDownList runat="server" ID="ddlLoaiSanPham" onchange="fnChangeLoai(this)"></asp:DropDownList>
            </p>
            <table  border="0" cellpadding="0" cellspacing="0">
                <tbody>
                    <tr>
                        <td>
                        <vajax:CallbackPanel runat="server" ID="cbpGrid">
                        <Content>
                                <table class="table_buy_cart_content" border="0" cellpadding="0" cellspacing="0">
                
                                    <tbody>
                    
                                            <asp:Repeater ID="lvDanhSach" runat="server">
                                            <HeaderTemplate>
                                                <tr>
                                                    <td></td>
                                                    <td>Tên</td>
                                                    <td>Ảnh</td>
                                                    <td>Giá</td>
                                                    <td>Số lượng</td>
                                                    <td>Thao tác</td>
                                                </tr>
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <tr>
                                                    <td><a class="delete" href="#" onclick="XoaSanPham('<%# Eval("Id") %>')" id="cart_delete_710_1211" title=""></a></td>
                                                    <td><%# Eval("Ten") %></td>
                                                    <td><a href="a_files/<%# Eval("Anh") %>"> <img style="" class="clsImage" src='a_files/<%# Eval("Anh") %>' height="60" width="50" /></a></td>
                                                    <td><%# Eval("Gia") %></td>
                                                    <td><%# Eval("SoLuong") %></td>
                                                    <td><a href="#" onclick="ShowDialog('PopupChiTiet.aspx?masanpham=<%# Eval("Id") %>',700,230);">Chi tiết</a> || <a href ="#" onclick="ShowDialog('PopupThemSP.aspx?sanpham=<%# Eval("Id") %>',700,230);">Sửa</a></td>
                                                </tr>
                                            </ItemTemplate>
                                        </asp:Repeater>
                        
                                    </tbody>
                            
                                </table>
                        </Content>
                        <Loading></Loading>
                    </vajax:CallbackPanel>
                        </td>
                    </tr>
                    
                </tbody>
            </table>
            <div class="header_login_show">
                <ul id="ctl00_uclogin1_login_show">
                    <li><a title="Thêm sản phẩm" href="#" onclick="ShowDialog('PopupThemSP.aspx',700,190);">Thêm sản phẩm</a></li>
                </ul>
            </div>
            <!-- cart-detail-end -->
              
        </div>

        <div class="buy_cart_bottom">
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
</asp:Content>
